import axios from '@/libs/api.request'

export const getMerchants = ({
  page,
  size
}) => {
  const data = {
    page,
    size
  }
  return axios.request({
    url: 'merchants/get_all_merchants',
    params: data,
    method: 'get'
  })
}

export const merchantsAudit = ({
  id
}) => {
  const data = {
    id
  }
  return axios.request({
    url: 'merchants/audit',
    params: data,
    method: 'get'
  })
}

/** 获取商户活动 */

export const getMerchantsActivities = ({
  page,
  size
}) => {
  const data = {
    page,
    size
  }
  return axios.request({
    url: 'mactivity/getAllActivity',
    params: data,
    method: 'get'
  })
}

/** 商户活动审核 */
export const activityAudit = ({
  id
}) => {
  const data = {
    id
  }
  return axios.request({
    url: 'mactivity/audit',
    params: data,
    method: 'get'
  })
}

export const getApplyActivityById = ({
  id,
  page,
  size
}) => {
  const data = {
    id,
    page,
    size
  }
  return axios.request({
    url: 'mactivity/get_apply',
    params: data,
    method: 'get'
  })
}

export const getMerchantsType = () => {
  return axios.request({
    url: 'merchants/getMerchantsType',
    method: 'get'
  })
}

export const typeSave = (data) => {
  const params = data
  return axios.request({
    url: 'merchants/type_save',
    params,
    method: 'post'
  })
}
